home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5502 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  60 lines

  1. Path: cyb.gridpoint.com!loodvrij
  2. From: "Bruce J. Keeler" <loodvrij@cyb.gridpoint.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: STL container classes and destroy()
  5. Date: Sun, 4 Feb 1996 20:23:27 -0900
  6. Organization: Internet Alaska, Inc.
  7. Message-ID: <Pine.BSF.3.91.960204202036.7806A-100000@cyb.gridpoint.com>
  8. NNTP-Posting-Host: cyb.alaska.net
  9. Mime-Version: 1.0
  10. Content-Type: TEXT/PLAIN; charset=US-ASCII
  11.  
  12. Hi.  I have a question about the STL container classes and their use with
  13. user-defined types.  The test program below fails to compile as shown.
  14. If I use vector<asdf *> it compiles but gives a warning similar to the message
  15. shown.  
  16.  
  17. In the stl defalloc.h file I notice a whole bunch of versions of
  18. destroy(foo) one for each built-in type.  Are we expected to include similar
  19. definitions in the header files for our classes?  Doing so certainly seems
  20. to get rid of the messages, but it still seems kinda klunky and possibly
  21. just darn wrong to me.
  22.  
  23. Compiler is the AIX xlC compiler, version (I think) 1.1.2.
  24.  
  25. Thanks.
  26. ---------------------------------------8<---------------------------------
  27. #include <vector.h>
  28.  
  29. class asdf
  30. {
  31.     asdf() {}
  32.     ~asdf() {}
  33.     int spam;
  34. };
  35.  
  36. class Blah
  37. {
  38.     vector<asdf> asdfList;
  39. };
  40.  
  41. int main (int, char **)
  42. {
  43.     Blah blah; 
  44. }
  45.  
  46. xlC -+ -U__STR__ -Istl -g
  47. -DMOD_SYM=3Dctgnd -DMODULE_NAME=3D"ctgnd" -c vector-test.cc
  48. "stl/defalloc.h", line 74.1: 1540-013: (S) "~T" is undefined.
  49. "stl/defalloc.h", line 73.1: 1540-207: (I) The previous message applies 
  50. to the definition of template "destroy(asdf*)".
  51.  
  52.  
  53.  
  54.  
  55.  
  56. Bruce J. Keeler                               Internet: loodvrij@gridpoint.com
  57. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  58. "Never trust an Operating System you don't have source code for."
  59.  
  60.